snippet gdbinit
  # ./.gdbinit
  # 使用 gdb-multiarch
  # 注意 如果使用虚拟环境，注意python虚拟环境位置
  # 注意 svd文件位置
  # 依赖 gdbundle,gdbundle-PyCortexMDebug, python pip安装
  # 配置 ~/.config/gdb/gdbinit > "set auto-load safe-path /"
  python
  import sys
  import os
  import gdb

  # 指定虚拟环境路径(如果需要)
  sys.path.insert(0, '/home/ankee/Compiler/py-env/debug-cortexm-env/lib/python3.12/site-packages')
  print("Added virtualenv to sys.path")

  import gdbundle
  print("gdbundle loaded")

  plugins = ["PyCortexMDebug"]
  gdbundle.init(include=plugins)
  print("Python gdbundle init...")

  gdb.execute("svd_load STM32F407.svd")

